class Customer {
  private String customerId;
  private String name;
  private List<Order> orders;
  public Customer(String customerId, String name) {
    this.customerId = customerId;
    this.name = name;
    this.orders = new ArrayList<>();
  }
  public void addOrder(Order order) {
    orders.add(order);
  }
}
class Order {
  private String orderId;
  private Customer customer;
  private List<OrderDetail> orderDetails;
  private Payment payment;
  public Order(String orderId, Customer customer) {
    this.orderId = orderId;
    this.customer = customer;
    this.orderDetails = new ArrayList<>();
  }
  public void addOrderDetail(OrderDetail orderDetail) {
    orderDetails.add(orderDetail);
  }
  public void setPayment(Payment payment) {
    this.payment = payment;
  }
}
class OrderDetail {
  private Product product;
  private int quantity;
  public OrderDetail(Product product, int quantity) {
    this.product = product;
    this.quantity = quantity;
  }
}
class Product {
  private String productId;
  private String name;
  public Product(String productId, String name) {
    this.productId = productId;
    this.name = name;
  }
}
class Payment {
  private String paymentId;
  public Payment(String paymentId) {
    this.paymentId = paymentId;
  }
}
class Credit extends Payment {
  private String cardNumber;
  public Credit(String paymentId, String cardNumber) {
    super(paymentId);
    this.cardNumber = cardNumber;
  }
}
class Cash extends Payment {
  private double amount;
  public Cash(String paymentId, double amount) {
    super(paymentId);
    this.amount = amount;
  }
}
class WireTransfer extends Payment {
  private String bankAccount;
  public WireTransfer(String paymentId, String bankAccount) {
    super(paymentId);
    this.bankAccount = bankAccount;
  }
}
class AliPay extends Payment {
  private String account;
  public AliPay(String paymentId, String account) {
    super(paymentId);
    this.account = account;
  }
}
class WeixinPay extends Payment {
  private String account;
  public WeixinPay(String paymentId, String account) {
    super(paymentId);
    this.account = account;
  }
}